<?php
/**
 * Created by PhpStorm.
 * User: mr.lee
 * Date: 2018/4/25
 * Time: 上午11:53
 */

namespace app\common\model;


use think\Model;
use think\Session;

class CardClickReplyPut extends Model
{
    protected $insert = ['addtime', 'adduser'];

    protected function setAddtimeAttr()
    {
        return time();
    }

    protected function setAdduserAttr()
    {
        return Session::get('user.nickname');
    }

    public function setEndtimeAttr($value)
    {
        return strtotime($value)+86399;
    }

    public function setStarttimeAttr($value)
    {
        return strtotime($value);
    }

//    public function setCardlistAttr($value)
//    {
//        return json_encode($this->card_zs_list($value), JSON_UNESCAPED_UNICODE);
//    }

//    function card_zs_list($data)
//    {
//        $arr = [];
//        foreach ($data['zs_card_id'] as $k => $v) {
//            $arr[] = [
//                'zs_card_id' => $v,
//                'zs_no' => $data['zs_no'][$k],
//            ];
//        }
//        return $arr;
//    }
    
}